package xiaohu.day5.HJ59;


import java.util.LinkedList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String str = scanner.nextLine();
            LinkedList<Character> list = new LinkedList<>();
            for (int i = 0; i < str.length(); i++) {
                if (!list.contains(str.charAt(i))) {
                    if (str.lastIndexOf(str.charAt(i)) == i) {
                        System.out.println(str.charAt(i));
                        return;
                    } else {
                        list.add(str.charAt(i));
                    }
                }
            }
            System.out.println(-1);
        }
    }
}
